<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>二叉树算法精解 - 最大深度问题</title>
    <link rel="stylesheet" href="https://cdn.staticfile.org/font-awesome/6.4.0/css/all.min.css">
    <link rel="stylesheet" href="https://cdn.staticfile.org/tailwindcss/2.2.19/tailwind.min.css">
    <link href="https://fonts.googleapis.com/css2?family=Noto+Serif+SC:wght@400;500;600;700&family=Noto+Sans+SC:wght@300;400;500;700&display=swap" rel="stylesheet">
    <script src="https://cdn.jsdelivr.net/npm/mermaid@latest/dist/mermaid.min.js"></script>
    <style>
        body {
            font-family: 'Noto Sans SC', Tahoma, Arial, Roboto, "Droid Sans", "Helvetica Neue", "Droid Sans Fallback", "Heiti SC", "Hiragino Sans GB", Simsun, sans-serif;
            background-color: #f8fafc;
            color: #1e293b;
        }
        .hero-gradient {
            background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
        }
        .code-block {
            background-color: #1e293b;
            border-left: 4px solid #7c3aed;
        }
        .concept-card:hover {
            transform: translateY(-5px);
            box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
        }
        .animate-float {
            animation: float 6s ease-in-out infinite;
        }
        @keyframes float {
            0%, 100% { transform: translateY(0); }
            50% { transform: translateY(-10px); }
        }
    </style>
</head>
<body class="min-h-screen antialiased">
    <!-- Hero Section -->
    <section class="hero-gradient text-white py-20 px-4">
        <div class="container mx-auto max-w-6xl">
            <div class="flex flex-col md:flex-row items-center">
                <div class="md:w-1/2 mb-10 md:mb-0">
                    <h1 class="text-4xl md:text-5xl font-bold leading-tight mb-4 font-serif">
                        二叉树<span class="text-indigo-200">最大深度</span>算法精解
                    </h1>
                    <p class="text-xl text-indigo-100 mb-8 leading-relaxed">
                        深入剖析递归与BFS两种解决方案，掌握树形数据结构的核心算法思想
                    </p>
                    <div class="flex space-x-4">
                        <div class="bg-white bg-opacity-20 px-4 py-2 rounded-full flex items-center">
                            <i class="fas fa-code-branch mr-2"></i>
                            <span>递归算法</span>
                        </div>
                        <div class="bg-white bg-opacity-20 px-4 py-2 rounded-full flex items-center">
                            <i class="fas fa-project-diagram mr-2"></i>
                            <span>BFS遍历</span>
                        </div>
                    </div>
                </div>
                <div class="md:w-1/2 flex justify-center">
                    <div class="relative w-full max-w-md animate-float">
                        <div class="mermaid">
                            graph TD
                                A[3] --> B[9]
                                A --> C[20]
                                C --> D[15]
                                C --> E[7]
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </section>

    <!-- Content Section -->
    <section class="py-16 px-4">
        <div class="container mx-auto max-w-6xl">
            <div class="grid md:grid-cols-3 gap-8">
                <!-- Problem Description -->
                <div class="md:col-span-2 bg-white rounded-xl shadow-md overflow-hidden">
                    <div class="p-8">
                        <div class="flex items-center mb-6">
                            <div class="bg-indigo-100 text-indigo-800 p-3 rounded-full mr-4">
                                <i class="fas fa-question-circle text-xl"></i>
                            </div>
                            <h2 class="text-2xl font-bold text-gray-800">题目描述</h2>
                        </div>
                        <div class="prose max-w-none text-gray-700">
                            <p class="mb-4">
                                给定一个二叉树，找出其最大深度。二叉树的深度为根节点到最远叶子节点的最长路径上的节点数。
                            </p>
                            <p class="mb-4">
                                例如，给定二叉树 <code class="bg-gray-100 px-2 py-1 rounded">[3,9,20,null,null,15